package com.itcast.cn.myhashset;

import java.util.HashSet;

/**
 * @PackageName: com.itcast.cn.myhashset
 * @ClassName: HashSetTest
 * @Author: wusong
 * @Date: 2020/7/6 0006 16:51
 * @Description:
 */
public class HashSetTest {
    public static void main(String[] args) {
        HashSet<Student>  hs = new HashSet<>();
        Student s1 =  new Student("刘忙",23);
        Student s2 =  new Student("菜鸡",22);
        Student s3 =  new Student("人才",24);
        Student s4 =  new Student("人才",24);

        hs.add(s1);
        hs.add(s2);
        hs.add(s3);
        hs.add(s4);
        for (Student student : hs) {
            System.out.println(student);
        }
    }

}

